<template>
  <el-card class="common-card">
    <div class="card-top">
      <div class="top-title">{{ title }}</div>
      <div class="top-value">{{ value }}</div>
    </div>
    <div class="card-middle">
      <slot></slot>
    </div>
    <div class="card-line"></div>
    <div class="card-bottom">
      <slot name="footer"></slot>
    </div>
  </el-card>
</template>

<script lang="ts">
export default {
  name: 'CommonCard'
};
</script>
<script lang="ts" setup>
// 接收传递过来的参数
const props = defineProps({
  title: {
    type: String, // 类型
    required:true, // 必须传
    default:''
  },
  value: {
    type: String,
    required:true,
    default:''
  }
});
</script>

<style lang="scss" scoped>
.common-card {
  .card-top {
    .top-title {
      font-size:12px;
      color:#999;
    }
    .top-value {
      font-size:25px;
      margin:5px 0;
      letter-spacing: 1px;
    }
  }
  .card-middle {
    height: 50px;
  }
  .card-line {
    border-bottom: 1px solid #eee;
    margin:10px 0;
  }
  .card-bottom {
    font-size:12px;
    color:#666;
  }
}
  
  
</style>